/*
 * @Author: kimsoso
 * @Date: 2022-01-06 14:00:27
 * @LastEditTime: 2022-03-14 16:47:18
 * @LastEditors: Please set LastEditors
 * @Description: 全局参数定义
 * @FilePath: /file-sync/ctypes/consts.go
 */
package consts

import "time"

const (
	// 命令归档过期时间
	ArchExpiredDuration = time.Minute * 5

	BufSize                = 16384   //缓冲大小, 8192=8k, 16384=16k, 32768=32k, 49152=48k
	SocketTimeout          = 3       //单位秒
	RetryTimes             = 3       //重试次数
	BLOCKSIZE              = 2097152 //数据块大小 256K,524288 512K,1048576 1M,2097152 2M, 4194304 4M
	IntegrityCheckInterval = 10

	COMM_PING = "COMM:PING" //探测节点
	COMM_PONG = "COMM:PONG" //探测节点回复OK

	COMM_TEST     = "COMM:TEST"       //测试命令
	COMM_OK       = "COMM:SUCCESS"    //成功
	COMM_FAILED   = "COMM:FAILED"     //失败
	COMM_NOTREADY = "COMM:NOTREADY"   //没有准备好
	COMM_CLOSE    = "COMM:CLOSE"      //退出
	COMM_SWITCH   = "COMM:SWITCHHOST" //切换Node

	COMM_REQNEWFILE       = "COMM:REQNEWFILE"       //请求新文件通知
	COMM_SendNewFile      = "COMM:SendNEWFILE"      //请求发送新文件通知
	COMM_ReadyReceiveFile = "COMM:ReadyReceiveFIle" //准备接收文件数据
	COMM_REVBLOCK         = "COMM:REVBLOCK"         //请求数据块

	COMM_BLOCKREQ   = "COMM:BLOCKREQ"   //请求传输块
	COMM_BLOCKEMPTY = "COMM:BLOCKEMPTY" //没有该文件的所有数据块
	COMM_BLOCKNOT   = "COMM:BLOCKNOT"   //没有该数据块
	COMM_BLOCKNEXT  = "COMM:BLOCKNEXT"  //下一个数据块

	COMM_ReqSendBlock = "COMM:SENDBLOCK" //请求发送数据块
	COMM_REQDIRSTRUCT = "COMM:DIRSTUCT"  //请求发送目录结构

	CLI_SENDFILE  = "CLI:NEWFILE"  //发送新文件
	CLI_SYNCFILE  = "CLI:SYNCFILE" //同步文件或目录
	CLI_DELFILE   = "CLI:DELFILE"  //删除文件
	CLI_DELFILES  = "CLI:DELFILES" //删除多个文件或文件夹
	CLI_FILE_LIST = "CLI:FILELIST" //罗列文件
	CLI_RNMFILE   = "CLI:RNMFILE"  //修改文件名

	CLI_FILE_NOTCHECK  = "0"  //文件没有被校验
	CLI_FILE_NOTEXIST  = "-1" //文件不存在
	CLI_FILE_DELETED   = "1"  // 删除成功
	CLI_FILE_ALDELETED = "2"  //已经被删除
)
